package uk.ac.cam.cl.oscar.sift;

/**
 * A class used to represent a best "match" between two
 * keypoints.  Used exclusively by the KeypointMatcher
 * and ImageFinder classes, this is really just a wrapper
 * so that the two matching keypoints and distances can
 * be compared.
 *
 * The actual contents of the class are not used in the
 * current implementation of sift.  With some careful
 * re-jigging of the ImageFinder, they could be used
 * to compare sets of matches.
 */
public class KeypointMatch
{
    // The distance between the descriptors
    private double distance;
    // The two keypoints that match
    private Keypoint kp1, kp2;

    // Methods to get the stuff in the descriptors
    public Keypoint getKeypoint1() { return this.kp1; }
    public Keypoint getKeypoint2() { return this.kp2; }
    public double getDistance() { return this.distance; }

    // Sets up the KeypointMatch with the specified variables
    public KeypointMatch(Keypoint a, Keypoint b, double dist)
    {
        this.kp1 = a;
        this.kp2 = b;
        this.distance = dist;
    }
} 
